#ifndef __STDTYPE_H__
#define __STDTYPE_H__

#include <stdbool.h>
#include <string.h>

#define on 1
#define off 0
#define nil 0
#define ResOK 0

// 常用类型简写
// char (-127~127), 项目配置开启 Plain Char is Signed
#define byte unsigned char    // 0~255
#define word unsigned short   // 0~65535
#define int8 signed char
#define int16 short           // -32,768~32,767
#define uint16 unsigned short // 0~65535
#define uint32 unsigned int   // 0~4294947295
#define error unsigned short

#define pchar char *
#define string char *
#define pstring char**
#define pbyte unsigned char *
#define pByte unsigned char *

#define pUint32 unsigned int *
#define pUint16 unsigned short *
    
// 函数指针
typedef void (*Proc)();
typedef void (*ProcBool)(bool AValue);
typedef void (*ProcUint16)(uint16 AValue);
typedef void (*ProcUint32)(uint32 AValue);
typedef void (*ProcPUint32)(pUint32 AValue);
typedef void (*ProcByte)(byte AValue);

typedef bool (*FuncBool)();

#define ErrTimeout 02
#define ErrRAMLack 04

typedef void (*TNotifyTouchKeyDown)(byte AKeyTag, bool IsLongPress);

#endif